var app = getApp();
var host = app.data.host
var httpUtil=require("../utils/httpUtil.js")
var allGoodsUrl = host + "getAllGoods"
var getProductUrl = host + "getProduct"
var getServiceUrl = host + "getService"
var getGoodsImgsUrl = host +"getGoodsImgs"
var getGoodsInfoUrl = host +"getGoodsInfo"
var getEvaluatesUrl = host +'getEvaluates'
//获取所有类型商品
function allGoods(data,cb) {
  httpUtil.get(allGoodsUrl, data,cb)
}
//获取普通商品
function getProduct(data,cb) {
  httpUtil.get(getProductUrl, data, cb)
}
//获取服务类商品
function getService(data,cb) {
  httpUtil.get(getServiceUrl, data, cb)
}
//获取商品图片详情
function getGoodsImgs(data,cb){
  httpUtil.get(getGoodsImgsUrl,data,cb)
}
//获取商品详情
function getGoodsInfo(data,cb){
  httpUtil.get(getGoodsInfoUrl,data,cb)
}
//获取评价
function getEvaluates(data,cb){
  httpUtil.get(getEvaluatesUrl, data, cb)
}

module.exports = {
  allGoods: allGoods,
  getProduct: getProduct,
  getService: getService,
  getGoodsImgs: getGoodsImgs,
  getGoodsInfo: getGoodsInfo,
  getEvaluates: getEvaluates,

}